﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace Fengsoft.AIBlog.Web.Models
{
    public class BlobModel
    {
        public string FileName
        {
            get;
            private set;
        }
        public DateTime ModifiedDate
        {
            get;
            private set;
        }
        public string Name
        {
            get;
            private set;
        }
        public string SeoFileName
        {
            get;
            private set;
        }
        public string SeoName
        {
            get;
            private set;
        }
        public BlobModel(string fileName)
        {
            FileInfo file=new FileInfo(fileName);
            string extension=file.Extension;
            FileName=file.FullName;
            SeoFileName=file.Name.Replace(extension,string.Empty);
            SeoName=SeoFileName.Substring(0,SeoFileName.Length-4);
            Name=SeoName.Replace("-"," ");
            ModifiedDate=file.LastWriteTimeUtc;
        }
    }
}